# Contributor: xatier
_pkgname=fcitx5-e04input
pkgname=fcitx5-e04input-git
pkgver=97.f08da14
pkgrel=1
pkgdesc="E04Input for fcitx5"
arch=('x86_64')
url="https://gitee.com/vChewing/E04Input"
license=('MIT')
depends=('fcitx5')
makedepends=('cmake' 'extra-cmake-modules')
optdepends=()
conflicts=('fcitx5-e04input')
provides=('fcitx5-e04input')
source=("${_pkgname}::git+https://gitee.com/vChewing/E04Input.git")
sha512sums=('SKIP')

pkgver() {
    cd "${srcdir}/${_pkgname}"
    echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

build() {
    cd "${srcdir}/${_pkgname}"
    mkdir -p build
    cd build
    cmake ../ -DCMAKE_INSTALL_PREFIX=/usr
    make
}

package() {
    cd "${srcdir}/${_pkgname}/build"
    make DESTDIR="${pkgdir}" install

    # install licence files
    install -dm755 "${pkgdir}/usr/share/licenses/${_pkgname}/"
    install -Dm644 "${srcdir}/${_pkgname}/LICENSE.txt" "${pkgdir}/usr/share/licenses/${_pkgname}/"
}
